fix(voice): wire debug messages over remote sessions#1645
Merged
Conversation
🦋 Changeset detectedLatest commit: 99ff231 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
toubatbrian
approved these changes
May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the new
AgentSessionEvent.debug_message(livekit/protocol#1593) throughSessionHost, and adds an internal-onlyAgentSession._emit_debug_message(payload)helper for the debugger/recorder (e.g.agents-cli).Not a user-facing API — the leading underscore +
:meta private:docstring marker signal that this is not intended to be called from user code. The event rides the existingAgentSessionEventwrapper on the wire; nothing else in the session lifecycle changes.Changes
pyproject.toml— bumpslivekit-protocolfloor>=1.1.9→>=1.1.10(picks upDebugMessage, the renamedAgentSessionEvent.debug_messagefield,FunctionToolsStarted,EotPrediction).voice/events.py—EventTypesliteral"custom_event"→"debug_message". No wrapper BaseModel.voice/agent_session.py:_emit_debug_message(payload: Mapping[str, Any]) -> None— wrapspayloadinto agoogle.protobuf.Structand emitsagent_pb.DebugMessage. Bypasses the typedemitoverride (which narrows toAgentEventfor the Pydantic event-trace report); debug messages ride the proto and aren't part of that typed taxonomy.from google.protobuf.json_format import ParseDict+from google.protobuf.struct_pb2 import Structlifted to module scope (per the no-inline-imports convention).voice/remote_session.py—SessionHostlistens on"debug_message"; the handler takesagent_pb.DebugMessageand forwards it throughAgentSessionEvent(debug_message=...).Usage (internal only)
```python
debugger / recorder code only — not for user code
session._emit_debug_message({"kind": "anomaly_detected", "score": 0.92})
```
External listeners can subscribe to the event topic via the EventEmitter, but the canonical emit path is the underscore method. There is no stable public emit API for debug events.
Test plan
Publishing pipeline
CI type-check is blocked until:
v1.46.4, version to1.1.10)After that the pin in
pyproject.toml(>=1.1.10) will resolve andmypywill seeagent_pb.DebugMessage. Same publishing-pipeline blocker as the previous1.1.9cut — no code change needed once the package is released.Notes
_emitDebugMessageshape on the JS side; published already against@livekit/protocol@1.46.4).